package com.yjd.pub.repayment.dao.impl;

import com.yjd.comm.repayment.dto.RepaymentOrderInfoDto;
import org.springframework.stereotype.Component;
import com.yjd.comm.base.dao.impl.BaseDaoImpl;
import com.yjd.comm.repayment.model.RepaymentDataModel;
import com.yjd.pub.repayment.dao.IRepaymentDataDao;

import java.util.List;
import java.util.Map;

/**
 * <b>description</b>：用户还款报表数据访问层 <br>
 * <b>time</b>：2017-06-27 08:56:34 <br>
 * <b>author</b>： yangchangyan@yijiedai.com
 */
@Component("repaymentDataDao")
public class RepaymentDataDaoImpl extends BaseDaoImpl implements IRepaymentDataDao {

	private static final String SQLMAPNAMESPACE = RepaymentDataModel.class.getName();
	private static final String PKNAME = "id";

	@Override
	public String getPrimaryKeyName() {
		return PKNAME;
	}

	@Override
	public String getSqlmapNamespace() {
		return SQLMAPNAMESPACE;
	}

	@Override
	public List<RepaymentDataModel> reminderRepaymentOrder(Map<String, Object> param) throws Exception {
		return (List<RepaymentDataModel>) this.getSqlMap(false).queryForList(getStatement("reminderRepaymentOrder"), param);
	}

	@Override
	public Double querySumPepaymentPrice(Map param) throws Exception {
		return (Double) this.getSqlMap(true).queryForObject(this.getStatement("querySumPepaymentPrice"),param);
	}

	@Override
	public List<RepaymentOrderInfoDto> getUpdateRepaymentOrderInfoList(Map param) throws Exception {
		return (List<RepaymentOrderInfoDto>) this.getSqlMap(false).queryForList(getStatement("getUpdateRepaymentOrderInfoList"), param);
	}
}
